package edu.yuhf.collectiondemo;

import edu.yuhf.vo.Person;

import java.util.Collections;
import java.util.List;

public class CollectionsExample {

    public void sort(List<Person> list){
        Collections.sort(list);
        list.stream().forEach(value->System.out.println(value.getId()));
        Collections.reverse(list);
        list.stream().forEach(value->System.out.println(value.getId()));
        Collections.shuffle(list);
        list.stream().forEach(value->System.out.println(value.getId()));
    }
}
